<template>
    <div>
       <div class="item" v-for="(item,index) in list"
        :key="index"
       >
       <span class="item-title-icon"></span>
       <div class="item-title border-bottom" v-show="showTitle">
           {{item.title}}</div>
     <div v-if="item.children" class="item-children">
              <detail-list :list="item.children"></detail-list>
         </div>
       </div>
    </div>
</template>

<script>
export default {
  name: 'DetailList',
  props: {
    list: Array
  },
  data () {
    return {
      showTitle: true
    }
  }
}
</script>

<style lang="stylus" scoped>
.border-bottom {
    &:before {
        border-color: #ccc;
    }
}
.item
    margin :-.5rem 0
 .item-title-icon
    display: inline-block
    position:relative
    top:.6rem
    width: .36rem
    height: .36rem
    background: url(http://s.qunarzz.com/piao/image/touch/sight/detail.png) 0 -.45rem no-repeat
    background-size: .4rem 3rem
    margin-left :.1rem
 .item-title
  line-height :.8rem
  font-size:.32rem
  padding:0 .1rem
  margin-left :.4rem
.item-children
   padding:0 .4rem
</style>
